Skip to content

fix: null in openapi enums breaks client generation BNCH-32257 #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

GitOnUp
Copy link

@GitOnUp GitOnUp commented Oct 13, 2021

OpenAPI specifies that if an enum is nullable, to specify - null in the list of possible items. This manifests as None when parsed in Python, and the parser tries to create a member in the enum class for it. This fails because it attempts to convert it to uppercase, and it's not a string, but None shouldn't get an enum value NULL or NONE anyway, because the client code would just pass None instead of EnumProperty.NONE for a nullable enum.

This change makes a change to support empty strings as well, mirroring the fix in upstream: https://github.com/openapi-generators/openapi-python-client/pull/358/files

@GitOnUp GitOnUp requested a review from bowenwr October 13, 2021 23:51
Copy link

@bowenwr bowenwr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@GitOnUp GitOnUp merged commit 800bf60 into benchling-sdk-m1-fixes-01282021 Oct 14, 2021
@eli-bl eli-bl deleted the george/fix-nulls branch November 26, 2024 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants